package com.jh.paymentchannel.payment;

import com.google.common.base.Joiner;
import com.google.common.collect.Maps;
import com.jh.paymentchannel.payment.wechat.WechatUtil;

import java.util.Map;

/**
 * @author Yichuan
 * @version 1.0
 */
public class PaymentResponse {

    public static Map<String, String> wechatResponse(String appId, String nonceStr, String prepayId) {
        Map<String, String> result = Maps.newHashMap();

        result.put("appId", appId);
        result.put("timeStamp", String.valueOf(WechatUtil.getCurrentTimestamp()));
        result.put("nonceStr", nonceStr);
        result.put("package", Joiner.on("=").join("prepay_id", prepayId));
        result.put("signType", "HMAC-SHA256");

        return result;
    }
}
